Skip to content

Import portable browser profile data - #229

Open
IlyaasK wants to merge 4 commits into
browser-import/03-connectorfrom
browser-import/04-profile-data
Open

Import portable browser profile data#229
IlyaasK wants to merge 4 commits into
browser-import/03-connectorfrom
browser-import/04-profile-data

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What

Extend kernel profiles import-local beyond cookies to import approved portable browser data from Chrome and Helium on macOS:

  • bookmarks, selected by default
  • browsing history from the configured --days window, selected by default
  • localStorage, selected by default with a 64 MiB review boundary
  • Chrome Web Store extension IDs, selected under the profile and organization plan limits
  • a final summary and approval before cookie/localStorage values are decrypted and uploaded

Passwords and supported TOTP seeds remain a separate Managed Auth step. IndexedDB, cache, arbitrary preferences, and extension state are intentionally excluded.

Why

A useful imported profile needs more than cookies. This keeps the moment-to-magic flow simple while preserving a portable, bounded contract and making sensitive categories visible before upload. History uses actual visits in the chosen time window instead of lifetime URL counters.

How

  • snapshot live Chromium SQLite and LevelDB data before reading
  • translate bookmarks, recent history, and localStorage into the existing portable bundle format
  • inspect only metadata before approval; export values only after selection
  • enforce the API 100,000-record, 1 MiB-record, 16/64 MiB-category, and 128 MiB-bundle limits locally
  • query stored-extension capacity and constrain non-interactive/default selection
  • preserve the existing cookies_imported JSON field while adding per-category results

Depends on kernel/kernel PR #3244 for server-side extension persistence and entitlement enforcement.

Verification

  • go test ./internal/browserimport ./cmd -count=1
  • go vet ./internal/browserimport ./cmd
  • go mod tidy -diff
  • git diff --check
  • make build
  • verified the generated help shows history enabled by default
  • exercised the LevelDB reader against the local Helium profile without exposing stored values

Note

Medium Risk
Touches sensitive local browser data (cookies, history, storage) and upload paths with new decryption/export timing; connector env injection affects auth for kernel:// launches.

Overview
kernel profiles import-local now imports bookmarks, browsing history (within --days, default on via --history), and localStorage in addition to cookies, not just cookies.

The flow gathers metadata first (counts/sizes), lets users multi-select categories and trim localStorage origins when total size exceeds 64 MiB, then shows a summary and confirmation before decrypting cookies and exporting values. Upload uses BuildProfileBundle with inventory/selection categories ordered cookies → storage → bookmarks → history; JSON output adds browser_data_imported while keeping cookies_imported.

internal/browserimport adds Chromium readers for Bookmarks, History (SQLite snapshots), and LevelDB local storage (with origin filtering and size caps), plus bundle encoding limits (records, per-file MiB, 128 MiB bundle). goleveldb is a new dependency.

internal/connector macOS handler now exports KERNEL_* env vars from launchctl before running the CLI so deep-linked imports inherit auth config.

Extension import mentioned in the PR description is not in this diff.

Reviewed by Cursor Bugbot for commit b2201c8. Bugbot is set up for automated code reviews on this repo. Configure here.

Import bookmarks, recent history, local storage, and selected Web Store extensions alongside cookies. Keep values local until final approval, enforce the API payload bounds in the CLI, and apply extension entitlements before upload.
@socket-security

socket-security Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​syndtr/​goleveldb@​v1.0.09610010075100

View full report

Comment thread cmd/browser_import_profile_data.go
Comment thread cmd/browser_import_profile_data.go
Comment thread cmd/browser_import_profile_data.go

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 60febc7. Configure here.

Comment thread internal/connector/connector.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant